﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// KhauPhanAnChiTiet Repository. Good example of CRUD operations.
    ///// </summary>
    public class KhauPhanAnChiTietRepository : IKhauPhanAnChiTietRepository
    {
        private static readonly IKhauPhanAnChiTietDao _khauPhanAnChiTiet= DataAccess.KhauPhanAnChiTietDao;
        public List<KhauPhanAnChiTiet> GetList()
        {
            return _khauPhanAnChiTiet.GetKhauPhanAnChiTiet().ToList();
        }

        public KhauPhanAnChiTiet Get(string id)
        {
            return _khauPhanAnChiTiet.GetKhauPhanAnChiTietByID(id);
        }

        public void Insert(KhauPhanAnChiTiet t)
        {
            _khauPhanAnChiTiet.InsertKhauPhanAnChiTiet(t);
        }

        public void Update(KhauPhanAnChiTiet t)
        {
            _khauPhanAnChiTiet.UpdateKhauPhanAnChiTiet(t);
        }

        public void Delete(KhauPhanAnChiTiet t)
        {
            _khauPhanAnChiTiet.DeleteKhauPhanAnChiTiet(t);
        }
    }
}